<script>
  jQuery(document).ready(function(){
    create_header('#players_stats', '400px');
  });
</script>
<form action="index.php" method="post" name="adminForm">
  
  <div id="tabs" style="padding-top:10px;">
    <ul>
      <? $letters = array('A', 'B' , 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); ?>
      <? foreach($letters as $letter): ?>
        <li><a href="<?= JURI::base(true) ?>/component/pbny/players#players-<?= $letter ?>"><?= $letter ?></a></li>      
      <? endforeach; ?>                
    </ul>
  </div>
  
  <? $cols = array();
     $cols['PPG']  = 'avg_points';
     $cols['FPG']  = 'avg_field_goals';
     $cols['FTPG'] = 'avg_free_throws';
     $cols['3PPG'] = 'avg_three_points';
     $cols['ORPG'] = 'avg_off_rebounds';
     $cols['DRPG'] = 'avg_def_rebounds';
     $cols['APG']  = 'avg_assists';
     $cols['SPG']  = 'avg_steals';
     $cols['BPG']  = 'avg_blocks';
  ?>
  
  <? 
    $pic      = null;
    $person   = $this->hme_player->person;
    $position = $this->hme_player->position; 
    $title    = "$person->lastname, $person->firstname | #".
          $this->hme_player->jersey_number." | ".
          $position->position;
    if(isset($this->hme_player->pic))
      $pic  = $this->hme_player->pic;
  ?>
  
  <? 
    $awy_pic  = null;
    $person   = $this->awy_player->person;
    $position = $this->awy_player->position; 
    $title    = "$person->lastname, $person->firstname | #".
          $this->awy_player->jersey_number." | ".
          $position->position;
    if(isset($this->awy_player->pic))
      $awy_pic = $this->awy_player->pic;
  ?>
    
  
  <table style="width:100%; text-align:center; margin-top:1em;">
    <tr>
      <td style="width:250px;" valign="top">  
        <div>
          <h2><?= $this->hme_player->person->lastname ?>, <?= $this->hme_player->person->firstname ?></h2>
          <h3>#<?= $this->hme_player->jersey_number ?> | <?= $this->hme_player->position->position ?></h3>
        </div>                
        <img style="padding-top:10px;" src="<?= PBNYHelper::getFlickrImageUrl($pic->flickr_id, 'small') ?> " width="200px" height="300px" alt="no image"><!-- home player pic -->
      </td>      
      <td>
        <div id="players_stats">
          <h3 style="padding-top:10px;">Players Stats</h3>
          <table style="width:100%">
            <tr>
              <td>
                <?  foreach($this->hme_player->player_game_stats as $s_id => $stat){ ?>
                  <h3><?= $this->seasons[$s_id] ?></h3>
                  <table class="table" style="width:100%">
                    <tbody>                      
                      <? foreach($cols as $key=>$value){ ?>
                        <tr>
                          <td class="cell_value"><?= $stat[$value] ?></td>
                          <td class="cell_key" style="width:50px;"><?= $key ?></td>                          
                        </tr>
                      <? } ?>                      
                    </tbody>
                  </table>
                  
                <?  } ?>  
              </td>
              <td>
                <? foreach($this->awy_player->player_game_stats as $s_id => $stat){ ?>
                  <h3><?= $this->seasons[$s_id] ?></h3>
                  <table class="table" style="width:100%">
                    <tbody>                      
                      <? foreach($cols as $key=>$value){ ?>
                        <tr>
                          <td class="cell_key" style="width:50px;"><?= $key ?></td>
                          <td class="cell_value"><?= $stat[$value] ?></td>
                        </tr>
                      <? } ?>                      
                    </tbody>
                  </table>
                  
                <?  } ?>
              </td>
            </tr>
          </table>
        </div>
      </td>
      <td style="width:250px;" valign="top">
        <div>
          <h2><?= $this->awy_player->person->lastname ?>, <?= $this->awy_player->person->firstname ?></h2>
          <h3>#<?= $this->awy_player->jersey_number ?> | <?= $this->awy_player->position->position ?></h3>
        </div>    
        <img style="padding-top:10px;" src="<?= PBNYHelper::getFlickrImageUrl($awy_pic->flickr_id, 'small') ?> " width="200px" height="300px" alt="no image"><!-- away player pic -->  
      </td>
    </tr>
  </table>  
</form>
